<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSystemMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_menus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 100);
            $table->string('display_name', 100);
            $table->string('url', 300)->default('');
            $table->string('icon', 50)->default('');
            $table->bigInteger('parent_id')->default(0);
            $table->tinyInteger('genre')->default(0);
            $table->tinyInteger('status')->default(0);
            $table->timestamps();
            $table->unique('name');
            $table->index('display_name');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_menus');
    }
}
